package com.yonyou.cyxdms.basedata.service.service.brand;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yonyou.cyx.framework.service.base.ICommonService;
import com.yonyou.cyxdms.basedata.client.domains.vo.BrandCacheVO;
import com.yonyou.cyxdms.basedata.client.domains.vo.VehicleVO;
import com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.BrandImportDTO;
import com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.BrandModifyDTO;
import com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.BrandQueryDTO;
import com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.GeneralBrandDTO;
import com.yonyou.cyxdms.basedata.service.entity.basedata.SystemParamPO;
import com.yonyou.cyxdms.basedata.service.entity.brand.BrandPO;
import com.yonyou.cyxdms.basedata.service.vo.CarbrandInfoVO;
import com.yonyou.cyxdms.basedata.service.vo.IntentCarCMSVO;
import com.yonyou.cyxdms.basedata.service.vo.IntentCarVo;
import com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO;
import com.yonyou.cyxdms.basedata.service.vo.brand.VehicleProductBrandVO;
import com.yonyou.cyxdms.basedata.service.vo.brand.VehicleProductDcsBrandVO;
import com.yonyou.cyxdms.framework.bean.dto.user_info.LoginInfoDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * 品牌
 *
 * @author renwd
 * @since 2018/12/7
 */
public interface BrandService extends ICommonService<BrandModifyDTO, BrandPO, Long> {

    /**
     * 按条件查询品牌信息
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.BrandCacheVO>
     * @author renwd
     * @since 2018/12/7
     */
    public List<BrandCacheVO> queryBrandByCondition(Map<String, Object> queryParam);

    /**
     * 根据DEALER_CODE查询所有的品牌信息
     *
     * @param
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.BrandCacheVO>
     * @author guorp
     * @since 2018/12/13
     */
    public List<BrandCacheVO> getBrand();

    /**
     * 根据经销商Id检索品牌信息
     *
     * @return void
     * @author zhangsx
     * @since 2018/9/14
     */
    public List<CarbrandInfoVO> queryCarbrandInfo(String appId);

    /**
     * 查询系统参数表转发URL
     *
     * @param appId
     * @param paramCode
     * @author Tansj
     * @since 2019/11/26
     */
    SystemParamPO queryRedirectUrl (String appId, String paramCode);

    /**
     * 获取转发后的响应数据
     *
     * @param appId
     * @param url
     * @author Tansj
     * @since 2019/11/26
     */
    String getRedirectResponse (String appId, String url);

    /**
     * 根据查询条件返回对应的品牌数据（pc）
     *
     * @param brandQueryDTO
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.yonyou.cyxdms.basedata.service.vo.brand.VehicleProductBrandVO>
     * @author renwd
     * @since 2019/7/10
     */
    IPage<VehicleProductBrandVO> queryVehicleProductBrand(Page<VehicleProductBrandVO> page, BrandQueryDTO brandQueryDTO);

    /**
     * dcs根据查询条件返回对应的品牌数据
     *
     * @param page
     * @param queryParam
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.yonyou.cyxdms.basedata.service.vo.brand.VehicleProductDcsBrandVO>
     * @author renwd
     * @since 2019/7/18
     */
    IPage<VehicleProductDcsBrandVO> queryVehicleProductDcsBrand(Page page, @Param("params") Map<String, Object> queryParam);

    /**
     * 下拉框显示品牌的方法
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO>
     * @author renwd
     * @since 2019/7/16
     */
    List<BrandDictVO> queryBrandDict(Map<String, Object> queryParam);

    /**
     * dcs下拉框显示品牌的方法
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO>
     * @author renwd
     * @since 2019/7/19
     */
    List<BrandDictVO> queryDcsBrandDict(Map<String, Object> queryParam);

    /**
     * 新增品牌
     *
     * @param brandDto
     * @return java.lang.Long
     * @author renwd
     * @since 2019/7/11
     */
    Integer addBrand(BrandModifyDTO brandDto);

    /**
     * 新增品牌
     *
     * @param brandDto
     * @return java.lang.Long
     * @author renwd
     * @since 2019/7/11
     */
    Integer addDcsBrand(BrandModifyDTO brandDto);

    /**
     * 修改品牌
     *
     * @param id
     * @param brandDto
     * @return void
     * @author renwd
     * @since 2019/7/16
     */
    Integer modifyBrand(Long id, BrandModifyDTO brandDto);

    /**
     * dcs修改品牌
     *
     * @param id
     * @param brandDto
     * @return java.lang.Integer
     * @author renwd
     * @since 2019/7/19
     */
    Integer modifyDcsBrand(Long id, BrandModifyDTO brandDto);

    /**
     * 导出
     *
     * @param queryParam 查询条件
     * @param request
     * @param response
     * @return void
     * @author renwd
     * @since 2019/7/12
     */
    void exportExcelForBrand(Map<String, Object> queryParam, HttpServletRequest request, HttpServletResponse response);


    /**
     * 提供给查询的下拉框的方法(包括无效的)
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO>
     * @author renwd
     * @since 2019/7/17
     */
    List<BrandDictVO> queryBrandsAll(Map<String, Object> queryParam);

    /**
     * @author ：quankk
     * @date ：2019/7/19 17:28
     * @description：
     */
    List<Map> queryBrand2(Map<String, Object> queryParam);

    /**
     * 品牌导入
     *
     * @param importFile
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.BrandImportDTO>
     * @author renwd
     * @since 2019/7/22
     */
    List<BrandImportDTO> importBrand(MultipartFile importFile);

    /**
     * 判断品牌是否存在
     *
     * @param brandName
     * @return com.yonyou.cyxdms.basedata.service.entity.brand.BrandPO
     * @author renwd
     * @since 2019/7/22
     */
    BrandPO existsBrand(String brandName);

    /**
     * @Description: 根据brandCode获取brandName
     * @Param: [appId, brandCode]
     * @Return: com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO
     * @Author: lijun
     * @Date: 16:02 2019/8/22
     **/
    BrandDictVO getByCode(String appId, String brandCode);

    Long queryBrandByAppidName(String appId, String brandName);

    Map<Long, String> queryBrandMapping(String appId);

    /**
     * 根据条件查询品牌，车系，车型，配置id列表
     *
     * @param searchCondition
     * @return com.yonyou.cyxdms.basedata.service.vo.VehicleVO
     * @author dengqiang
     * @since 2019/9/17
     */
    VehicleVO getIdListByCondition(String searchCondition);

    Map<String, Object> queryBrandRelatedData(Long brandId, Long modelId, Long seriesId, Long packageId, Long optionId);

    /**
     * 通用-新增品牌
     * @param brandDto
     * @return
     */
    void addBrandGeneral(List<GeneralBrandDTO> brandDto);

    List<BrandCacheVO> getAllBrandByAppId(String appId);


    Map<String, Object> queryBrandRelatedDataByCode(String brandCode, String modelCode, String seriesCode, String packageCode, String optionCode, String appId);

    /**
     * 设置登录信息传参
     *
     * @param: queryParam
     * @auther: Tansj
     * @since: 2019/11/14
     */
    Map<String, Object> setLoginInfoParam(Map<String, Object> queryParam, LoginInfoDto loginInfoDto);

    /**
     * 品系型查询界面品牌下拉框
     *
     * @author Tansj
     * @since 2019/11/15
     */
    List<BrandDictVO> queryBrandDictAll();

    /**
     * 新增编辑界面本店面品牌下拉框
     *
     * @author Tansj
     * @since 2019/11/15
     */
    List<BrandDictVO> queryBrandDictOwner();

    /**
     * 新增编辑界面dcs品牌下拉框
     *
     * @author Tansj
     * @since 2019/11/15
     */
    List<BrandDictVO> queryDcsBrandDict();

    Map<Long, IntentCarVo> queryBrandRelatedAll(Map<Long, IntentCarVo> paramArr);

    Map<Long, IntentCarCMSVO> queryBrandRelatedAllCms(Map<Long, IntentCarCMSVO> paramArr);

    Map<String, IntentCarCMSVO> queryBrandRelatedAllCmsOptimization(Map<String, IntentCarCMSVO> paramArr);

    IntentCarVo queryUpIntentCar(IntentCarVo intentCarVo);

    List<BrandDictVO> queryBrandDictAllNopar();

}
